<template>
	<view class="">
		<view class="header p-30">
			<view class="cf font-30 flex-center" style="margin-top: 15px;">
				成妃
			</view>
			<view class="header-nav m-40 flex-justify-between m-t-80">
				<view class="header-nav-item" v-for="(item,index) in navList" :key="index" @click="goNav(item)">
					<view class="header-nav-item-image bgf flex-center">
						<image :src="item.img" mode="" class=""></image>
					</view>
					<view class="cf">{{item.name}}</view>
				</view>
			</view>
		</view>
		<view class="nav flex-justify-between">
			<view class="nav-item" style="border-right: 2rpx solid #ccc;" @click="goShopTable(1)">
				<image src="../../static/daodian.png" mode=""></image>
				<view class="">
					<text class="font-36">到店前</text>
					<text class="c9 font-24">数据分析</text>
				</view>
			</view>
			<view class="nav-item" @click="goShopTable(2)">
				<image src="../../static/daodianhou.png" mode=""></image>
				<view class="">
					<text class="font-36">到店后</text>
					<text class="c9 font-24">数据分析</text>
				</view>
			</view>
		</view>
		<view class="pro p-30 bgf">
			<view class="tips m-b-30">
				<image src="../../static/type-tips.png" mode=""></image>
				引流品项
			</view>
			<view class="pro-nav flex-justify-between">
				<view class="pro-nav-item s-flex-direction flex-center" v-for="(item,index) in proList" :key="index"
					@click="goPath">
					<image :src="item.img" mode=""></image>
					<text>{{item.name}}</text>
				</view>
			</view>
		</view>
		<view class="m-20">
			<u-swiper :list="list1" :radius="8"></u-swiper>
		</view>
		<view class="bussiness p-30 bgf">
			<view class="tips m-b-30">
				<image src="../../static/bussiness-tips.png" mode=""></image>
				合作店家
			</view>
			<view class="">
				<global-bussiness-item v-for="(item,index) in shopList" :item="item" :key="index"></global-bussiness-item>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				navList: [{
						name: '查流量',
						img: require('@/static/chaxun.png'),
						path: '/views/customer/index'
					},
					{
						name: '查订金',
						img: require('@/static/qianbao1.png'),
						path:'/views/deposit/index'
					},
					{
						name: '查预约',
						img: require('@/static/yuyue.png'),
						path:'/views/appoint/index'
					},
					{
						name: '查业绩',
						img: require('@/static/yeji.png'),
						path:'/views/performance/index'
					}
				],
				proList: [{
						name: '半永久',
						img: require('@/static/banyongjiu.png')
					},
					{
						name: '面部',
						img: require('@/static/mianbu.png')
					},
					{
						name: '医美',
						img: require('@/static/yimei.png')
					},
					{
						name: '光电',
						img: require('@/static/shuidi.png')
					},
					{
						name: '其它',
						img: require('@/static/qita.png')
					}
				],
				list1: [
					'https://cdn.uviewui.com/uview/swiper/swiper1.png',
					'https://cdn.uviewui.com/uview/swiper/swiper2.png',
					'https://cdn.uviewui.com/uview/swiper/swiper3.png',
				],
				shopList:[]
			}

		},
		onLoad() {
			this.getShopList()
		},
		methods: {
			goNav(item) {
				// console.log(item)
				uni.navigateTo({
					url: item.path
				})
			},
			goPath() {
				uni.navigateTo({
					url: "/views/empty/index"
				})
			},
			async getShopList(){
				const {data} = await this.$api.home.partner()
				console.log(data)
				this.shopList = data
			},
			goShopTable(type){
				uni.navigateTo({
					url:`/views/shopTable/index?type=${type}`
				})
			}
			

		}
	}
</script>

<style lang="scss" scoped>
	.header {
		background: #3b70e9;
		padding-bottom: 54rpx;

		.header-nav-item {
			// display: flex;
			// flex-direction: column;
			// justify-content: center;
			// align-items: center;
			// flex:1;
			text-align: center;

			// background: #fff;
			// padding: 20rpx;
			&-image {
				padding: 10rpx;
				margin-bottom: 20rpx;
				border-radius: 30rpx;
			}

			image {
				width: 80rpx;
				height: 80rpx;
				border-radius: 20rpx;
			}
		}
	}

	.nav {
		// position: relative;
		background: #fff;
		border-radius: 30rpx;
		padding: 30rpx;
		margin: 30rpx;
		// top: -70rpx;
		box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
		margin-top: -70rpx;

		image {
			width: 100rpx;
			height: 100rpx;
			border-radius: 50%;
		}

		&-item {
			flex: 1;
			display: flex;
			justify-content: center;

			view {
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
				margin-left: 30rpx;
			}
		}
	}

	.pro {
		&-nav {
			&-item {
				image {
					width: 80rpx;
					height: 80rpx;
					border-radius: 40%;
					margin-bottom: 20rpx;
				}
			}
		}
	}

	.tips {
		border-bottom: 2rpx solid #eee;
		padding: 10rpx;
		display: flex;
		align-items: center;

		image {
			width: 40rpx;
			height: 40rpx;
			margin-right: 10rpx;

		}
	}
</style>